<?php

/* Bootstrap */
require '../application/bootstrap.php';


for ($i = 0; $i < 200; $i++) {
    // Send message to server
    $client = new Zend_Http_Client('http://localhost/peXi/htdocs/server.php');
    $client->setMethod(Zend_Http_Client::POST);

    $mode = mt_rand(0, 1) ? 'synchronous' : 'asynchronous';

    $client->setParameterPost(array(
        'message' => $message = uniqid(),
        'mode' => $mode
    ));

    $response = $client->request();

    echo $i . ' - ' . $message . ' - ' . $mode . ' - ' . $response->getStatus() . '<br>';
    flush();
}